package com.mail.job;


import com.mail.dto.SendEmailDto;
import com.mail.utils.MailSendUtil;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
import org.quartz.JobDataMap;
import org.quartz.JobExecutionContext;
import org.springframework.scheduling.quartz.QuartzJobBean;
import org.springframework.web.multipart.MultipartFile;

@Slf4j
public class SendEmailJob extends QuartzJobBean {
    @Override
    protected void executeInternal(@NonNull JobExecutionContext context) {
        JobDataMap jobDataMap = context.getJobDetail().getJobDataMap();
        SendEmailDto sendEmailDto= (SendEmailDto) jobDataMap.get("email");
        MailSendUtil.sendTextMail(sendEmailDto);
        log.info("send email job start..............................");
    }
}
